package com.cskaoyan.exception;

import com.cskaoyan.bean.common.BaseRespVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author stone
 * @date 2022/10/13 22:33
 */
@RestControllerAdvice
public class WdExceptionControllerAdvice {

    @ExceptionHandler(WdValidationException.class)
    public BaseRespVo validationExceptionResolver(WdValidationException exception) {
        String message = exception.getMessage();
        return BaseRespVo.invalidParameter(message);
    }
}
